package com.hushan.elevator.vo;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class MonitorDtree {
    String name;
    int deviceNumb;
    int deptNumb;
    int deptId;
    List<MonitorDept> childDeptList = new ArrayList<>();
    List<MonitorDevice> childDeviceList = new ArrayList<>();
   public  void addChildDept(String name, int number ,int deptId) {
        deptNumb+=1;
        deviceNumb+=number;
        childDeptList.add(new MonitorDept(name,number,deptId));
    }

    public void addChildDevice(String name, int state ,int deviceId,String serial) {
        deviceNumb+=1;
        childDeviceList.add(new MonitorDevice(name,state,deviceId,serial));
    }
}
@Data
@AllArgsConstructor
class MonitorDept{
    String name;
    int deviceNumb;
    int deptId;
}
@AllArgsConstructor
@Data
class MonitorDevice{
    String name;
    int state;
    int deviceId;
    String serial;
}

